﻿using System;
using System.Collections.Generic;
//
//this code 
//
namespace uottawatourguide.Helpers
{
    public class CircularBehavior<T>
    {
        public static LinkedListNode<T> NextOrFirst(LinkedListNode<T> current)
        {
            if (current.Next == null)
                return current.List.First;
            return current.Next;
        }

        public static LinkedListNode<T> PreviousOrLast(LinkedListNode<T> current)
        {
            if (current.Previous == null)
                return current.List.Last;
            return current.Previous;
        }
    }
}
